#include "cregion.h"
#include "cconstdefinition.h"
#include <QDebug>

using namespace cooking;

CRegion::CRegion(QObject *parent) :
    CObject(parent) {
//    m_id = KInvalidId;
    m_description = KNullString;
    m_name = KNullString;
    m_picture = KNullString;
    m_parentId = KInvalidId;
}

//int CRegion::id() {
//    return m_id;
//}

//void CRegion::setId(int id) {
//    if (m_id != id) {
//        m_id = id;
//        emit idChanged();
//    }
//}

int CRegion::parentId() {
    return m_parentId;
}

void CRegion::setParentId(int id) {
    qDebug()<<QString("this:%1,oldId:%2, newId:%3").arg((int)this).arg(m_parentId).arg(id);
    if (m_parentId != id) {
        m_parentId = id;
        emit parentIdChanged();
    }
}

QString CRegion::name() {
    return m_name;
}

void CRegion::setName(QString name) {
    if (m_name != name) {
        m_name = name;
        emit nameChanged();
    }
}

QString CRegion::description() {
    return m_description;
}

void CRegion::setDescription(QString description) {
    if (m_description != description) {
        m_description = description;
        emit descriptionChanged();
    }
}

QString CRegion::picture() {
    return m_picture;
}
void CRegion::setPicture(QString picture) {
    if (m_picture != picture) {
        m_picture = picture;
        emit pictureChanged();
    }
}

